package com.sgb.jicai.entity;

import android.text.TextUtils;

import com.swgk.core.util.TimeUtil;

import java.io.Serializable;
import java.util.List;

/**
 * 需方发起  参与报价页面   加盟单位列表实体类
 */
public class JiCaiQuotedPriceCompanyEntity implements Serializable {

    private String placeOfDelivery;
    private String directorNumber;
    private String createTime;
    private String director;
    private String placeOfRepository;
    private String contactNumber;
    private String contacts;
    private String remarks;
    private String createCompany;
    private List<RecordsDataEntity> offerList;
    private int groupbuyClass;

    public int getGroupbuyClass() {
        return groupbuyClass;
    }

    public void setGroupbuyClass(int groupbuyClass) {
        this.groupbuyClass = groupbuyClass;
    }

    public String getPlaceOfDelivery() {
        return placeOfDelivery;
    }

    public void setPlaceOfDelivery(String placeOfDelivery) {
        this.placeOfDelivery = placeOfDelivery;
    }

    public String getDirectorNumber() {
        return directorNumber;
    }

    public void setDirectorNumber(String directorNumber) {
        this.directorNumber = directorNumber;
    }

    public String getCreateTime() {
        if (!TextUtils.isEmpty(createTime)) {
            return TimeUtil.getDateTimeString(Long.valueOf(createTime), "yyyy-MM-dd HH:mm");
        } else {
            return "";
        }
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public String getPlaceOfRepository() {
        return placeOfRepository;
    }

    public void setPlaceOfRepository(String placeOfRepository) {
        this.placeOfRepository = placeOfRepository;
    }

    public String getContactNumber() {
        return contactNumber;
    }

    public void setContactNumber(String contactNumber) {
        this.contactNumber = contactNumber;
    }

    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getCreateCompany() {
        return createCompany;
    }

    public void setCreateCompany(String createCompany) {
        this.createCompany = createCompany;
    }

    public List<RecordsDataEntity> getOfferList() {
        return offerList;
    }

    public void setOfferList(List<RecordsDataEntity> offerList) {
        this.offerList = offerList;
    }

    public class RecordsDataEntity implements Serializable {
        private String supplyTime;
        private String supplyTimeStart;
        private String unitName;
        private String joinCount;
        private String marketLowPrice;
        private String createCompany;
        private String placeOfDelivery;
        private String createTime;
        private String placeOfRepository;
        private String price;
        private String contactNumber;
        private List<AttrsBean> attr ;
        private String rangeBrands;
        private String contacts;
        private String stock;
        private String goodsMaterial;
        private String goodsQuality;
        private String goodsMaintenance;
        private String goodsPurpose;
        private int  shoptype;

        public int getShoptype() {
            return shoptype;
        }

        public void setShoptype(int shoptype) {
            this.shoptype = shoptype;
        }

        public String getGoodsMaterial() {
            if (!TextUtils.isEmpty(goodsMaterial)){
                return goodsMaterial;
            }else {
                return "/";
            }
        }

        public void setGoodsMaterial(String goodsMaterial) {
            this.goodsMaterial = goodsMaterial;
        }

        public String getGoodsQuality() {
            if (!TextUtils.isEmpty(goodsQuality)){
                return goodsQuality;
            }else {
                return "/";
            }
        }

        public void setGoodsQuality(String goodsQuality) {
            this.goodsQuality = goodsQuality;
        }

        public String getGoodsMaintenance() {
            if (!TextUtils.isEmpty(goodsMaintenance)){
                return goodsMaintenance;
            }else {
                return "/";
            }
        }

        public void setGoodsMaintenance(String goodsMaintenance) {
            this.goodsMaintenance = goodsMaintenance;
        }

        public String getGoodsPurpose() {
            if (!TextUtils.isEmpty(goodsPurpose)){
                return goodsPurpose;
            }else {
                return "/";
            }
        }

        public void setGoodsPurpose(String goodsPurpose) {
            this.goodsPurpose = goodsPurpose;
        }
        public String getSupplyTimeStart() {
            if (!TextUtils.isEmpty(supplyTimeStart) && !supplyTimeStart.equals("0")) {
                try {
                    return TimeUtil.getDateStringYMD(Long.valueOf(supplyTimeStart));
                } catch (Exception e) {
                    if (supplyTimeStart.contains("-")) {
                        try {
                            supplyTimeStart = String.valueOf(TimeUtil.getLongTime(supplyTimeStart, "yyyy-MM-dd"));
                        } catch (Exception e1) {
                            e1.printStackTrace();
                        }
                    }
                    return TimeUtil.getDateStringYMD(Long.valueOf(supplyTimeStart));
                }

            } else {
                if (!TextUtils.isEmpty(supplyTime)){
                    return TimeUtil.getDateStringYMD(Long.valueOf(Long.parseLong(supplyTime) - (24 * 60 * 60 * 1000)));
                }else {
                    return "";
                }
            }
        }

        public void setSupplyTimeStart(String supplyTimeStart) {
            this.supplyTimeStart = supplyTimeStart;
        }

        public String getMarketLowPrice() {
            return marketLowPrice;
        }

        public void setMarketLowPrice(String marketLowPrice) {
            this.marketLowPrice = marketLowPrice;
        }

        public String getStock() {
            return stock;
        }

        public void setStock(String stock) {
            this.stock = stock;
        }

        public List<AttrsBean> getAttr() {
            return attr;
        }

        public void setAttr(List<AttrsBean> attr) {
            this.attr = attr;
        }


        /**
         * 价格预警 1 大于 2 等于 3 小于
         */
        private int priceWarning;

        private List<AttrlistEntity> priceRule;

        public String getSupplyTime() {
//            return supplyTime;
            if (!TextUtils.isEmpty(supplyTime)) {
                return TimeUtil.getDateTimeString(Long.valueOf(supplyTime), "yyyy-MM-dd");
            } else {
                return "";
            }
        }

        public void setSupplyTime(String supplyTime) {
            this.supplyTime = supplyTime;
        }

        public String getUnitName() {
            return unitName;
        }

        public void setUnitName(String unitName) {
            this.unitName = unitName;
        }

        public String getJoinCount() {
            return joinCount;
        }

        public void setJoinCount(String joinCount) {
            this.joinCount = joinCount;
        }

        public String getCreateCompany() {
            return createCompany;
        }

        public void setCreateCompany(String createCompany) {
            this.createCompany = createCompany;
        }

        public String getPlaceOfDelivery() {
            return placeOfDelivery;
        }

        public void setPlaceOfDelivery(String placeOfDelivery) {
            this.placeOfDelivery = placeOfDelivery;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public String getPlaceOfRepository() {
            return placeOfRepository;
        }

        public void setPlaceOfRepository(String placeOfRepository) {
            this.placeOfRepository = placeOfRepository;
        }

        public String getPrice() {
            return price;
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public String getContactNumber() {
            return contactNumber;
        }

        public void setContactNumber(String contactNumber) {
            this.contactNumber = contactNumber;
        }


        public String getRangeBrands() {
            return rangeBrands;
        }

        public void setRangeBrands(String rangeBrands) {
            this.rangeBrands = rangeBrands;
        }

        public String getContacts() {
            return contacts;
        }

        public void setContacts(String contacts) {
            this.contacts = contacts;
        }

        public int getPriceWarning() {
            return priceWarning;
        }

        public void setPriceWarning(int priceWarning) {
            this.priceWarning = priceWarning;
        }

        public List<AttrlistEntity> getPriceRule() {
            return priceRule;
        }

        public void setPriceRule(List<AttrlistEntity> priceRule) {
            this.priceRule = priceRule;
        }
    }


    public class AttrlistEntity implements Serializable {
        private String intervalStartValue;
        private String groupbuyingNo;
        private String offerNo;
        private String price;
        private String detailNo;
        private String intervalEndValue;
        private String id;
        private String sort;

        public String getIntervalStartValue() {
            return intervalStartValue;
        }

        public void setIntervalStartValue(String intervalStartValue) {
            this.intervalStartValue = intervalStartValue;
        }

        public String getGroupbuyingNo() {
            return groupbuyingNo;
        }

        public void setGroupbuyingNo(String groupbuyingNo) {
            this.groupbuyingNo = groupbuyingNo;
        }

        public String getOfferNo() {
            return offerNo;
        }

        public void setOfferNo(String offerNo) {
            this.offerNo = offerNo;
        }

        public String getPrice() {
            return price;
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public String getDetailNo() {
            return detailNo;
        }

        public void setDetailNo(String detailNo) {
            this.detailNo = detailNo;
        }

        public String getIntervalEndValue() {
            return intervalEndValue;
        }

        public void setIntervalEndValue(String intervalEndValue) {
            this.intervalEndValue = intervalEndValue;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getSort() {
            return sort;
        }

        public void setSort(String sort) {
            this.sort = sort;
        }
    }


    public static class AttrsBean implements Serializable {
        private String name;
        private String value;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }
}

